#ifndef SECTIONDESCENDANTMODEL_H
#define SECTIONDESCENDANTMODEL_H

#include <QAbstractItemModel>

template <typename Type> class GraphNode;
class SectionInfo;

class SectionDescendantModel : public QAbstractListModel
{
    Q_OBJECT
public:
    explicit SectionDescendantModel(QObject *parent = 0);

    const GraphNode<SectionInfo>* sectionNode() const;
    GraphNode<SectionInfo>* sectionNode();

    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;

public slots:
    void initialize();
    void setSectionNode (GraphNode<SectionInfo>* sectionNode);

private:
    GraphNode<SectionInfo>* m_sectionNode;
    QList<GraphNode<SectionInfo>*> m_descendants;
};

#endif // SECTIONDESCENDANTMODEL_H
